//
// ***********************************************
// *    ___________   ___________  __      __    *
// *   |______  __/  /_____  ___/  \ \    / /    *
// *         / /          / /       \ \  / /     *
// *        / /          / /         \ \/ /      *
// *       / /          / /           \  /       *
// *      / /______    / /            / /        *
// *     /________/   /_/            /_/         *
// *                                             *
// ***********************************************
//
//   TimerManager.m
//   InterviewDemo
//   
//   Created  by wanmeizty on 26/12/2019
//   Modified by Tiyon  qq 897574226  
//   Copyright © 2019 wanmeizty. All rights reserved.
//   
   

#import "TimerManager.h"
#import "NSTimer+Extension.h"
@interface TimerManager ()
@property (strong,nonatomic) NSTimer * timer;
@end

@implementation TimerManager

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self.timer setFireDate:[NSDate distantPast]];
    }
    return self;
}

-(NSTimer *)timer{
    if (!_timer) {
        _timer = [NSTimer HH_scheduledTimerWithTimeInterval:1 target:self selector:@selector(startCount) userInfo:nil repeats:YES];
//        _timer = [NSTimer scheduledTimerWithTimeInterval:1 target:weakSelf selector:@selector(startCount) userInfo:nil repeats:YES];
    }
    return _timer;
}

-(void)startCount{
    NSLog(@"start");
}

-(void)dealloc{
    [_timer invalidate];
    NSLog(@"dealloc");
}
@end
